FROM php:7.4-fpm-alpine
#更换阿里源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories\
  #nobody uid和gid改为99
  && sed -i s/65534/99/g /etc/passwd &&sed -i s/65534/99/g /etc/group \
  && apk update &&apk add --no-cache autoconf gcc g++ \
  libtool make libmemcached zlib libmemcached-dev libpng \
  libpng-dev freetype-dev libjpeg-turbo-dev gettext-dev libmcrypt-dev\
  libpq-dev \
  libzip-dev \
  zip \
  gmp-dev \
  &&docker-php-ext-configure gd  \
  && docker-php-ext-install -j$(nproc) gd gettext sockets pdo_mysql mysqli\
  #pgsql pdo_pgsql 
  && docker-php-ext-install -j$(nproc) pgsql pdo_pgsql\
  && docker-php-ext-install bcmath\
  #gmp
   && docker-php-ext-install gmp\
  # 新增laravel 需要的扩展 pcntl zip
  && docker-php-ext-install  pcntl\
  && docker-php-ext-install  zip\
  #mcrypt
  &&pecl install mcrypt\
  && docker-php-ext-enable mcrypt\
  #igbinary
  && pecl install igbinary\
  && docker-php-ext-enable igbinary\
  # xlswriter
  && pecl install xlswriter\
  && docker-php-ext-enable xlswriter\
  #swoole
  && pecl install swoole-4.8.11\
  && docker-php-ext-enable swoole\
  #redis 
  && pecl install redis-5.2.1\
  && docker-php-ext-enable redis\
  # mongodb
  && pecl install mongodb \
  && docker-php-ext-enable mongodb\
  && mkdir -p /data/logs&&mkdir -p /data/www
#COPY php.ini $PHP_INI_DIR/

#COPY www.conf /usr/local/etc/php-fpm.d/www.conf
ENV COMPOSER_HOME /root/composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
ENV PATH $COMPOSER_HOME/vendor/bin:$PATH
RUN composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
#将源码 复制到里面来
WORKDIR  /data/www 
# COPY    ./erp-v2    /data/www/ 
# RUN cd  /data/www/ && composer install 
EXPOSE 5200
# ENTRYPOINT ["php", "/data/www/bin/laravels", "start"]
